package com.zhu.SupermarketInventoryManagement.prototype;

import java.util.Scanner;

public class LoginPrototype {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.print("用户名：");
        String username = scanner.next();
        System.out.print("密码：");
        String password = scanner.next();

        System.out.println("----------登录成功----------");
        boolean flag = true;
        while (index()) {
        }

    }

    public static boolean index() {
        Scanner scanner = new Scanner(System.in);
        int op1;
        int op2;
        int op3;
        System.out.println("1. 商品管理  2.员工管理  3.货物记录  4.退出登录");
        System.out.print("指令: ");
        op1 = scanner.nextInt();
        if (op1 == 1) {
            GoodsManagerPrototype.show();
            System.out.println("1. 添加商品  2.预览商品  3.修改商品  4.删除商品  5.返回");
            System.out.print("指令: ");
            op2 = scanner.nextInt();
            if (op2 == 2) {
                System.out.print("预览商品的id: ");
                op3 = scanner.nextInt();
                GoodsManagerPrototype.show(op3);
            } else {
            }
            return true;
        } else if (op1 == 2) {
            return true;
        } else if (op1 == 3) {
            return true;
        } else if (op1 == 4) {
            System.out.println("----------退出系统----------");
            return false;
        } else {
            System.out.println("无效指令, 重新输入");
            return true;
        }
    }
}
